package com.zh.test.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;

@Component
public class noBean {
    String name = "张辉";

    @GetMapping("/noBean")
    public void show(){
        System.out.print("非controller中设置mapper");
    }

    @Autowired
    public void testAutowired(){
        System.out.println("当类被注入到spring中,这个方法被自动运行");
    }



}
